package xm.align.box.info
{
	
	/**
	 * 설명         : 정렬 오브젝트 <br>
	 * 최초 작성  : 김정환 <br> 
	 * 수정         : <br>  
	 */
	public class AlignInfo
	{
		
		//-----------------------------------------------------------------------------------
		// private vars
		//-----------------------------------------------------------------------------------
		private var _padding : Array = [0,0,0,0];
		
		
		
		
		//-----------------------------------------------------------------------------------
		// constructor
		//-----------------------------------------------------------------------------------
		
		/**
		 * @param __padding
		 */		
		public function AlignInfo( __padding:Array = null )
		{
			if( __padding != null ) padding = __padding;
		}
		
		
		
		//-----------------------------------------------------------------------------------
		// setter / getter
		//-----------------------------------------------------------------------------------
		/**
		 * @param ary 패딩셋팅
		 */		
		public function set padding( ary:Array ):void
		{
			if( ary.length < 4 )
			{
				var len : int = 4-ary.length;
				for( var i:int = 0; i<len; i++ ) ary.push( 0 );
			}
			
			_padding = ary;
		}
		
		public function set paddingTop( num : Number ):void
		{
			_padding[ 0 ] = num;
		}
		
		public function set paddingRight( num : Number ):void
		{
			_padding[ 1 ] = num;
		}
		
		public function set paddingBottom( num : Number ):void
		{
			_padding[ 2 ] = num;
		}
		
		public function set paddingLeft( num : Number ):void
		{
			_padding[ 3 ] = num;
		}
		
		public function get paddingTop():Number
		{
			return _padding[ 0 ];
		}
		
		public function get paddingRight():Number
		{
			return _padding[ 1 ];
		}
		
		public function get paddingBottom():Number
		{
			return _padding[ 2 ];
		}
		
		public function get paddingLeft():Number
		{
			return _padding[ 3 ];
		}
		
		
		
		
		
		//-----------------------------------------------------------------------------------
		// destroy
		//-----------------------------------------------------------------------------------
		/**
		 * destory
		 */		
		public function destroy():void
		{
			var len : int = _padding.length;
			for( var i:int = 0; i<len; i++ )
			{
				_padding[ 0 ] = NaN;
				delete _padding.shift();
			}
		}
	}
}